{include file="../application/admin/view/header.html"}
</head>
<body>
<div class="container">
    <div class="col-md-12">
        <div class="alert kesn_prompt"></div>
    </div>
<div class="row">
   <form class="form-horizontal">
      <div class="form-group">
        <label for="img_id" class="col-sm-2 control-label">ID</label>
        <div class="col-sm-10">
          <input type="text" class="form-control" id="img_id" placeholder="" disabled="disabled" value="{$img.id}">
        </div>
      </div>
      <div class="form-group">
        <label for="describe" class="col-sm-2 control-label">描述</label>
        <div class="col-sm-10">
          <input type="text" class="form-control" id="describe" placeholder="" value="{$img.describe}">
        </div>
      </div>
      <div class="form-group">
        <label for="img_path" class="col-sm-2 control-label">原图</label>
        <div class="col-sm-10">
        <img src="/static/img/mainweb/{$img.path}" alt="" style="width: 150px;height: 50px;">
          <!-- <input type="" class="form-control" id="describe" placeholder=""> -->
        </div>
      </div>
    </form>
     <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
          <button class="btn btn-success" id="save">保存</button>
        </div>
      </div>
    
</div>
</div>


{include file="../application/admin/view/footer.html"}
<script type="text/javascript">
$('#save').click(function(){
  var img_id = $('input#img_id').val();
  var describe = $('input#describe').val();
  $.ajax({
        url : 'edit_describe',
        async:true,
        type:'POST',
        data:{
          describe:describe,
          img_id:img_id
        },
        dataType:'JSON',
        success:function(data,textStatus,jqXHR){
              if (data.err != 0) {
                kesn_prompt('fail',data.content);
              }else if (data.err == 0) {
                  kesn_prompt('success',data.content);  
                }
               
            },
            error:function(){
             
            }
      });

});
</script>
</footer>
</body>
</html>